	var nDialogWidth1 = 300;
	var nDialogHeight1 = 400;
	var nLeft1 = (window.screen.availWidth-nDialogWidth1)/2;
	var nTop1 = (window.screen.availHeight-nDialogHeight1)/2;
	var sFeatures1 = "dialogLeft:"+nLeft1+"px;dialogTop:"+nTop1+"px;dialogHeight:"+nDialogHeight1+"px;dialogWidth:"+nDialogWidth1+"px;help:no;status:no";

	var nDialogWidth2 = 800;
	var nDialogHeight2 = 600;
	var nLeft2 = (window.screen.availWidth-nDialogWidth2)/2;
	var nTop2 = (window.screen.availHeight-nDialogHeight2)/2;
	var sFeatures2 = "dialogLeft:"+nLeft2+"px;dialogTop:"+nTop2+"px;dialogHeight:"+nDialogHeight2+"px;dialogWidth:"+nDialogWidth2+"px;help:no;status:no";

//select one dept
function selOneDept(oId,oName){
	var tempStr = eval("document.all."+oId).value;
	var url="/sys/select/get/selectOneDept";
	var returnVal = window.showModalDialog(url,tempStr,sFeatures1);
	if(returnVal != null && "" != returnVal){
		var tempStr = returnVal.split("\|");
		eval("document.all."+oId).value = tempStr[0];
		eval("document.all."+oName).value = tempStr[1];
	}
}

//select multi depts
function selMultiDept(oId,oName){
	var existDeptIds = eval("document.all."+oId).value;
	var url="/sys/select/get/selectMultiDept";
	var returnVal = window.showModalDialog(url,existDeptIds,sFeatures1);
	if(returnVal == null || returnVal == ""){
		eval("document.all."+oId).value = "";
   		eval("document.all."+oName).value = ""; 
	}else{
		var returnDeptIds = "";
		var returnDeptNames = "";
		var tempStr = returnVal.split(",");
		for(var i=0;i<tempStr.length;i++){
			returnDeptIds = returnDeptIds+tempStr[i].split("%")[0]+"|";
			returnDeptNames = returnDeptNames+tempStr[i].split("%")[1]+",";
		}
   		eval("document.all."+oId).value = returnDeptIds;
   		eval("document.all."+oName).value = returnDeptNames.substring(0,returnDeptNames.length-1); 
	}
}

//select one user
function selOneUser(oId,oName){
	var userId = eval("document.all."+oId).value;
	var userName = eval("document.all."+oName).value;
	var existUserStr = userId+"|"+userName;
	var url="/sys/select/get/selectOneUserIndex";
	var returnVal = window.showModalDialog(url,existUserStr,sFeatures2);
	if(returnVal != null && "" != returnVal){
		if(returnVal == "|"){
			eval("document.all."+oId).value = "";
			eval("document.all."+oName).value = ""; 
		}else{
			var returnUserId = returnVal.split("\|")[0];
			var returnUserName = returnVal.split("\|")[1];
			eval("document.all."+oId).value = returnUserId;
			eval("document.all."+oName).value = returnUserName; 
		}
	}
}


//select multi user
function selMultiUser(oId,oName){
	var userIds = eval("document.all."+oId).value;
	var userNames = eval("document.all."+oName).value;
	if(userNames != null && userNames != "")
		userNames = userNames+"|";
	var existUserStrs = userIds+"$"+userNames.replace(/\,/g,"|");
	var url="/sys/select/get/selectMultiUserIndex";
	var returnVal = window.showModalDialog(url,existUserStrs,sFeatures2);
	if(returnVal == null || returnVal == "")
		return false;
	if(returnVal == "$"){
		eval("document.all."+oId).value = "";
		eval("document.all."+oName).value = ""; 
	}else{
 		var returnUserIds = returnVal.split("$")[0];
 		var returnUserNames = returnVal.split("$")[1];
 		eval("document.all."+oId).value = returnUserIds;
 		eval("document.all."+oName).value = returnUserNames.substring(0,returnUserNames.length-1).replace(/\|/g,","); 
	}
}

//select multi user for All
function selMultiUserForAll(oId,oName){
	var userIds = eval("document.all."+oId).value;
	var userNames = eval("document.all."+oName).value;
	if(userNames != null && userNames != "")
		userNames = userNames+"|";
	var existUserStrs = userIds+"$"+userNames.replace(/\,/g,"|");
	var url="/sys/select/get/selectMultiUserForAllIndex";
	var returnVal = window.showModalDialog(url,existUserStrs,sFeatures2);
	if(returnVal == null || returnVal == "")
		return false;
	if(returnVal == "$"){
		eval("document.all."+oId).value = "";
		eval("document.all."+oName).value = ""; 
	}else{
 		var returnUserIds = returnVal.split("$")[0];
 		var returnUserNames = returnVal.split("$")[1];
 		eval("document.all."+oId).value = returnUserIds;
 		eval("document.all."+oName).value = returnUserNames.substring(0,returnUserNames.length-1).replace(/\|/g,","); 
	}
}

//select multi role
function selMultiRole(oId,oName){
	var roleIds = eval("document.all."+oId).value;
	var roleNames = eval("document.all."+oName).value;
	if(roleNames != null && roleNames != "")
		roleNames = roleNames+"|";
	var existRoleStrs = roleIds+"$"+roleNames.replace(/\,/g,"|");
	var url="/sys/select/get/selectMultiRoleIndex";
	var returnVal = window.showModalDialog(url,existRoleStrs,sFeatures2);
	if(returnVal == null || returnVal == "")
		return false;
	if(returnVal == "$"){
		eval("document.all."+oId).value = "";
		eval("document.all."+oName).value = ""; 
	}else{
 		var returnRoleIds = returnVal.split("$")[0];
 		var returnRoleNames = returnVal.split("$")[1];
 		eval("document.all."+oId).value = returnRoleIds;
 		eval("document.all."+oName).value = returnRoleNames.substring(0,returnRoleNames.length-1).replace(/\|/g,","); 
	}
}

//select multi module
function selMultiModule(oId,oName){
	var roleIds = eval("document.all."+oId).value;
	var roleNames = eval("document.all."+oName).value;
	if(roleNames != null && roleNames != "")
		roleNames = roleNames+"|";
	var existRoleStrs = roleIds+"$"+roleNames.replace(/\,/g,"|");
	var url="/sys/select/get/selectMultiModuleIndex";
	var returnVal = window.showModalDialog(url,existRoleStrs,sFeatures2);
	if(returnVal == null || returnVal == "")
		return false;
	if(returnVal == "$"){
		eval("document.all."+oId).value = "";
		eval("document.all."+oName).value = ""; 
	}else{
 		var returnRoleIds = returnVal.split("$")[0];
 		var returnRoleNames = returnVal.split("$")[1];
 		eval("document.all."+oId).value = returnRoleIds;
 		eval("document.all."+oName).value = returnRoleNames.substring(0,returnRoleNames.length-1).replace(/\|/g,","); 
	}
}

//select multi position
function selMultiPosition(oId,oName){
	var positionIds = eval("document.all."+oId).value;
	var positionNames = eval("document.all."+oName).value;
	if(positionNames != null && positionNames != "")
		positionNames = positionNames+"|";
	var existPositionStrs = positionIds+"$"+positionNames.replace(/\,/g,"|");
	var url="/sys/select/get/selectMultiPositionIndex";
	var returnVal = window.showModalDialog(url,existPositionStrs,sFeatures2);
	if(returnVal == null || returnVal == "")
		return false;
	if(returnVal == "$"){
		eval("document.all."+oId).value = "";
		eval("document.all."+oName).value = ""; 
	}else{
 		var returnPositionIds = returnVal.split("$")[0];
 		var returnPositionNames = returnVal.split("$")[1];
 		eval("document.all."+oId).value = returnPositionIds;
 		eval("document.all."+oName).value = returnPositionNames.substring(0,returnPositionNames.length-1).replace(/\|/g,","); 
	}
}


//select one position
function selOnePosition(oId,oName){
	var userId = eval("document.all."+oId).value;
	var userName = eval("document.all."+oName).value;
	var existUserStr = userId+"|"+userName;
	var url="/sys/select/get/selectOnePositionIndex";
	var returnVal = window.showModalDialog(url,existUserStr,sFeatures2);
	if(returnVal != null && "" != returnVal){
		if(returnVal == "|"){
			eval("document.all."+oId).value = "";
			eval("document.all."+oName).value = ""; 
		}else{
			var returnUserId = returnVal.split("\|")[0];
			var returnUserName = returnVal.split("\|")[1];
			eval("document.all."+oId).value = returnUserId;
			eval("document.all."+oName).value = returnUserName; 
		}
	}
}

//select multi channel
function selMultiChannel(oId,oName){
	var channelIds = eval("document.all."+oId).value;
	var channelNames = eval("document.all."+oName).value;
	if(channelNames != null && channelNames != "")
		channelNames = channelNames+"|";
	var existChannelStrs = channelIds+"$"+channelNames.replace(/\,/g,"|");
	var url="/sys/select/get/selectChannelIndex";
	var returnVal = window.showModalDialog(url,existChannelStrs,sFeatures2);
	if(returnVal == null || returnVal == "")
		return false;
	if(returnVal == "$"){
		eval("document.all."+oId).value = "";
		eval("document.all."+oName).value = ""; 
	}else{
 		var returnChannelIds = returnVal.split("$")[0];
 		var returnChannelNames = returnVal.split("$")[1];
 		eval("document.all."+oId).value = returnChannelIds;
 		eval("document.all."+oName).value = returnChannelNames.substring(0,returnChannelNames.length-1).replace(/\|/g,","); 
	}
}

